class ClassStandingsController < ApplicationController
  # GET /class_standings
  # GET /class_standings.xml
  def index
    @class_standings = ClassStanding.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @class_standings }
    end
  end

  # GET /class_standings/1
  # GET /class_standings/1.xml
  def show
    @class_standing = ClassStanding.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @class_standing }
    end
  end

  # GET /class_standings/new
  # GET /class_standings/new.xml
  def new
    @class_standing = ClassStanding.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @class_standing }
    end
  end

  # GET /class_standings/1/edit
  def edit
    @class_standing = ClassStanding.find(params[:id])
  end

  # POST /class_standings
  # POST /class_standings.xml
  def create
    @class_standing = ClassStanding.new(params[:class_standing])

    respond_to do |format|
      if @class_standing.save
        flash[:notice] = 'ClassStanding was successfully created.'
        format.html { redirect_to(@class_standing) }
        format.xml  { render :xml => @class_standing, :status => :created, :location => @class_standing }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @class_standing.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /class_standings/1
  # PUT /class_standings/1.xml
  def update
    @class_standing = ClassStanding.find(params[:id])

    respond_to do |format|
      if @class_standing.update_attributes(params[:class_standing])
        flash[:notice] = 'ClassStanding was successfully updated.'
        format.html { redirect_to(@class_standing) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @class_standing.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /class_standings/1
  # DELETE /class_standings/1.xml
  def destroy
    @class_standing = ClassStanding.find(params[:id])
    @class_standing.destroy

    respond_to do |format|
      format.html { redirect_to(class_standings_url) }
      format.xml  { head :ok }
    end
  end
end
